#ifndef TSCRIPTDELEGATE_H
#define TSCRIPTDELEGATE_H

#include <QSqlRelationalDelegate>
#include <QObject>
#include <QWidget>
#include <QPainter>
#include <QMouseEvent>
#include "tjson.h"
class tScriptDelegate : public QSqlRelationalDelegate
{
    Q_OBJECT
public:
    tScriptDelegate();
    // QAbstractItemDelegate interface
public:
    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    void setEditorData(QWidget *editor, const QModelIndex &index) const;
    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
    void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;

    // QAbstractItemDelegate interface
public:
    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;

};

#endif // TSCRIPTDELEGATE_H
